home *** CD-ROM | disk | FTP | other *** search
Wrap
Subject: FW_CFrame::AdjustCursor Sent: 5/17/96 7:13 PM Received: 5/22/96 8:31 AM From: Hutchings Software Development, hsd@earthlink.net Reply-To: ODF-Interest@CILabs.ORG To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs. Nice meeting many on the ODF team this week at WWDC. I hope you're all using Cyberdog at this point. Symptom: ODF Table sometimes has a delayed response to mouse clicks while in "Edit" mode. Problem: CTableFrame::AdjustCursor is taking a long time (i.e. >10 ticks) to run. Here is a replacement AdjustCursor method for CTableFrame. My changes are in blue. It causes a beep when the elapsed time of the inherited call and the selection of the cursor take more than 10 ticks. You'll get a few beeps when you run either the debug or release build. FW_Boolean CTableFrame::AdjustCursor(Environment* ev, ODFacet* odFacet, const FW_CPoint& where) { FW_Boolean cursorAdjusted = FALSE; // I don't want the Open Hand Cursor if I have the grid hidden because I am not supposed to // be able to move anything unsigned long ticks = TickCount(); if (fGridShown) cursorAdjusted = FW_CEmbeddingFrame::AdjustCursor(ev, odFacet, where); if (!cursorAdjusted && fGridShown) { CCell cell; ETableLoc tl = HitTest(ev, where, cell); cursorAdjusted = TRUE; if (tl == kTLCell || tl == kTLNone) FW_gArrowCursor.Select(); else if (tl == kTLLeftBorder || tl == kTLRightBorder) FW_gSizeWECursor.Select(); else if (tl == kTLTopBorder || tl == kTLBottomBorder) FW_gSizeNSCursor.Select(); else FW_gSizeNWSECursor.Select(); } if ((TickCount() - ticks) > 10) { FW_Beep(); } return cursorAdjusted; } I haven't tracked this behavior down any further... Brad Richard B. "Brad" Hutchings General Partner, Hutchings Software Development hsd@earthlink.net <SMALLER><X-FONTSIZE><PARAM>10</PARAM><X-FONTNAME><PARAM>Geneva</PARAM>Nice meeting many on the ODF team this week at WWDC. I hope you're all using Cyberdog at this point. </X-FONTNAME></X-FONTSIZE></SMALLER><BOLD><SMALLER><X-FONTSIZE><PARAM>10</PARAM><X-FONTNAME><PARAM>Geneva</PARAM>Symptom:</X-FONTNAME></X-FONTSIZE></SMALLER></BOLD><SMALLER><X-FONTSIZE><PARAM>10</PARAM><X-FONTNAME><PARAM>Geneva</PARAM> ODF Table sometimes has a delayed response to mouse clicks while in "Edit" mode. </X-FONTNAME></X-FONTSIZE></SMALLER><BOLD><SMALLER><X-FONTSIZE><PARAM>10</PARAM><X-FONTNAME><PARAM>Geneva</PARAM>Problem:</X-FONTNAME></X-FONTSIZE></SMALLER></BOLD><SMALLER><X-FONTSIZE><PARAM>10</PARAM><X-FONTNAME><PARAM>Geneva</PARAM> CTableFrame::AdjustCursor is taking a long time (i.e. >10 ticks) to run. Here is a replacement AdjustCursor method for CTableFrame. My changes are in </X-FONTNAME></X-FONTSIZE></SMALLER><X-COLOR><PARAM>RED=0;GREEN=9830;BLUE=61603</PARAM><SMALLER><X-FONTSIZE><PARAM>10</PARAM><X-FONTNAME><PARAM>Geneva</PARAM>blue</X-FONTNAME></X-FONTSIZE></SMALLER></X-COLOR><SMALLER><X-FONTSIZE><PARAM>10</PARAM><X-FONTNAME><PARAM>Geneva</PARAM>. It causes a beep when the elapsed time of the inherited call and the selection of the cursor take more than 10 ticks. You'll get a few beeps when you run either the debug or release build. </X-FONTNAME></X-FONTSIZE></SMALLER><SMALLER><SMALLER><X-FONTSIZE><PARAM>9</PARAM><X-FONTNAME><PARAM>MPW</PARAM> FW_Boolean CTableFrame::AdjustCursor(Environment* ev, ODFacet* odFacet, const FW_CPoint& where) { FW_Boolean cursorAdjusted = FALSE; // I don't want the Open Hand Cursor if I have the grid hidden because I am not supposed to // be able to move anything </X-FONTNAME></X-FONTSIZE></SMALLER></SMALLER><X-COLOR><PARAM>RED=0;GREEN=9830;BLUE=61603</PARAM><SMALLER><SMALLER><X-FONTSIZE><PARAM>9</PARAM><X-FONTNAME><PARAM>MPW</PARAM> unsigned long ticks = TickCount(); </X-FONTNAME></X-FONTSIZE></SMALLER></SMALLER></X-COLOR><SMALLER><SMALLER><X-FONTSIZE><PARAM>9</PARAM><X-FONTNAME><PARAM>MPW</PARAM> if (fGridShown) cursorAdjusted = FW_CEmbeddingFrame::AdjustCursor(ev, odFacet, where); if (!cursorAdjusted && fGridShown) { CCell cell; ETableLoc tl = HitTest(ev, where, cell); cursorAdjusted = TRUE; if (tl == kTLCell || tl == kTLNone) FW_gArrowCursor.Select(); else if (tl == kTLLeftBorder || tl == kTLRightBorder) FW_gSizeWECursor.Select(); else if (tl == kTLTopBorder || tl == kTLBottomBorder) FW_gSizeNSCursor.Select(); else FW_gSizeNWSECursor.Select(); } </X-FONTNAME></X-FONTSIZE></SMALLER></SMALLER><X-COLOR><PARAM>RED=0;GREEN=9830;BLUE=61603</PARAM><SMALLER><SMALLER><X-FONTSIZE><PARAM>9</PARAM><X-FONTNAME><PARAM>MPW</PARAM> if ((TickCount() - ticks) > 10) { FW_Beep(); } </X-FONTNAME></X-FONTSIZE></SMALLER></SMALLER></X-COLOR><SMALLER><SMALLER><X-FONTSIZE><PARAM>9</PARAM><X-FONTNAME><PARAM>MPW</PARAM> return cursorAdjusted; } </X-FONTNAME></X-FONTSIZE></SMALLER></SMALLER><SMALLER><X-FONTSIZE><PARAM>10</PARAM><X-FONTNAME><PARAM>Geneva</PARAM> I haven't tracked this behavior down any further... Brad Richard B. "Brad" Hutchings General Partner, Hutchings Software Development hsd@earthlink.net</X-FONTNAME></X-FONTSIZE></SMALLER>